package org.jsola.hr.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import org.jsola.core.dto.BaseDTO;

import javax.validation.constraints.NotNull;

import java.util.List;

import static org.jsola.hr.example.PolicyCourierExample.E_ANNEX;
import static org.jsola.hr.example.PolicyCourierExample.E_COMPANY_PERMISSIONS;
import static org.jsola.hr.example.PolicyCourierExample.E_COMPANY_PERMISSIONS_JSON;
import static org.jsola.hr.example.PolicyCourierExample.E_CONTENT;
import static org.jsola.hr.example.PolicyCourierExample.E_CONTENT_HAS_STYLE;
import static org.jsola.hr.example.PolicyCourierExample.E_POLICY_LEVEL;
import static org.jsola.hr.example.PolicyCourierExample.E_SORT;
import static org.jsola.hr.example.PolicyCourierExample.E_TITLE;
import static org.jsola.hr.example.PolicyCourierExample.E_TYPE_CODE;
import static org.jsola.hr.example.PolicyCourierExample.M_ANNEX_MAX;
import static org.jsola.hr.example.PolicyCourierExample.M_COMPANY_PERMISSIONS_JSON_MAX;
import static org.jsola.hr.example.PolicyCourierExample.M_COMPANY_PERMISSIONS_MAX;
import static org.jsola.hr.example.PolicyCourierExample.M_CONTENT_HAS_STYLE_MAX;
import static org.jsola.hr.example.PolicyCourierExample.M_CONTENT_MAX;
import static org.jsola.hr.example.PolicyCourierExample.M_POLICY_LEVEL_MAX;
import static org.jsola.hr.example.PolicyCourierExample.M_POLICY_LEVEL_NOT_NULL;
import static org.jsola.hr.example.PolicyCourierExample.M_TITLE_MAX;
import static org.jsola.hr.example.PolicyCourierExample.M_TITLE_NOT_NULL;
import static org.jsola.hr.example.PolicyCourierExample.M_TYPE_CODE_MAX;
import static org.jsola.hr.example.PolicyCourierExample.M_TYPE_CODE_NOT_NULL;
import static org.jsola.hr.example.PolicyCourierExample.N_ANNEX;
import static org.jsola.hr.example.PolicyCourierExample.N_COMPANY_PERMISSIONS;
import static org.jsola.hr.example.PolicyCourierExample.N_COMPANY_PERMISSIONS_JSON;
import static org.jsola.hr.example.PolicyCourierExample.N_CONTENT;
import static org.jsola.hr.example.PolicyCourierExample.N_CONTENT_HAS_STYLE;
import static org.jsola.hr.example.PolicyCourierExample.N_POLICY_LEVEL;
import static org.jsola.hr.example.PolicyCourierExample.N_SORT;
import static org.jsola.hr.example.PolicyCourierExample.N_TITLE;
import static org.jsola.hr.example.PolicyCourierExample.N_TYPE_CODE;

/**
 * 政策速递
 *
 * @author zhr
 */
@EqualsAndHashCode(callSuper = true)
@ApiModel(description = "新增【政策速递】的参数")
@Data
public class PolicyCourierAddDTO extends BaseDTO {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(notes = N_TITLE, example = E_TITLE, required = true)
    @NotNull(message = M_TITLE_NOT_NULL)
    @Length(max = 50, message = M_TITLE_MAX)
    private String title;

    @ApiModelProperty(notes = N_TYPE_CODE, example = E_TYPE_CODE, required = true)
    @NotNull(message = M_TYPE_CODE_NOT_NULL)
    @Length(max = 32, message = M_TYPE_CODE_MAX)
    private String typeCode;

    @ApiModelProperty(notes = N_ANNEX, example = E_ANNEX)
    @Length(max = 1000, message = M_ANNEX_MAX)
    private String annex;

    @ApiModelProperty(notes = N_POLICY_LEVEL, example = E_POLICY_LEVEL, required = true)
    @NotNull(message = M_POLICY_LEVEL_NOT_NULL)
    @Length(max = 5, message = M_POLICY_LEVEL_MAX)
    private String policyLevel;

    @ApiModelProperty(notes = N_CONTENT, example = E_CONTENT)
    @Length(max = 2147483647, message = M_CONTENT_MAX)
    private String content;

    @ApiModelProperty(notes = N_CONTENT_HAS_STYLE, example = E_CONTENT_HAS_STYLE)
    @Length(max = 2147483647, message = M_CONTENT_HAS_STYLE_MAX)
    private String contentHasStyle;

    @ApiModelProperty(notes = N_SORT, example = E_SORT)
    private Integer sort;

    @ApiModelProperty(notes = N_COMPANY_PERMISSIONS, example = E_COMPANY_PERMISSIONS)
    @Length(max = 5000, message = M_COMPANY_PERMISSIONS_MAX)
    private String companyPermissions;

    @ApiModelProperty(notes = N_COMPANY_PERMISSIONS_JSON, example = E_COMPANY_PERMISSIONS_JSON)
    @Length(max = 5000, message = M_COMPANY_PERMISSIONS_JSON_MAX)
    private String companyPermissionsJson;

    @ApiModelProperty(notes = "用工单位或分组列表")
    List<CompanyTypeDTO> companyTypeList;
}

